package com.sakura.springboottest.controller;

import com.sakura.springboottest.entity.Test;
import com.sakura.springboottest.repository.TestRepository;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping(value = "/test")
public class TestController {
    @Resource
    private TestRepository testRepository;

    @RequestMapping(value = "/findAll")
    public List<Test> findAll(){
//        System.out.println(testRepository.findAll());
        return testRepository.findAll();
    }
}
